Skip to content

fix warp assert on pow of 2#382

Open
39ali wants to merge 2 commits intoRust-GPU:mainfrom
39ali:warp-assert
Open

fix warp assert on pow of 2#382
39ali wants to merge 2 commits intoRust-GPU:mainfrom
39ali:warp-assert

Conversation

@39ali
Copy link
Copy Markdown

@39ali 39ali commented Apr 26, 2026

Summary

Rust ! on integers is bitwise NOT, not logical NOT, now it should assert correctly on none pow of 2

  • cargo build passes
  • cargo clippy --workspace passes
  • Tested on: [OS, GPU, CUDA version]

Notes

Any additional context for reviewers.

Comment thread crates/cuda_std/src/warp.rs Outdated

assert!(
!(width & (width - 1)) != 0 && width <= 32,
width != 0 && (width & (width - 1)) == 0 && width <= 32,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's true, we should use it, changing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants